﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;


namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class OMarketQualificationAddDetail : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }
        protected override string DWZRef
        {
            get { return "OMarketQualificationList"; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();
            }
            BindVerifyDate();
        }
        protected void addmenu()
        {
            OMarketQualificationDetailInfo obj = Request.SerializableObject<OMarketQualificationDetailInfo>();
            obj.MQID = MQID;

            this.AddLog(Permission.新增, "", obj);
            if (OMarketQualificationController.AddDetail(obj) > 0)
                SuccessJson("添加成功");
            else
                ErrorJson("添加失败");
        }

        #region 获取信息
        /// <summary>
        /// 需要修改的ID
        /// </summary>
        protected int MQID
        {
            get
            {
                return GetRequestValue<int>("MQID");
            }
        }

        private OMarketQualificationInfo _obj2;
        protected OMarketQualificationInfo obj2
        {
            get
            {
                if (_obj2 == null)
                {
                    _obj2=OMarketQualificationController.GetByID(MQID);
                }
                return _obj2;
                //OMenuController.ge
            }
        }

        protected void BindVerifyDate()
        {
            rpVerify.DataSource = OMarketQualificationController.GetDetailByMQID(MQID);
            rpVerify.DataBind();
        }
        #endregion
    }
}